home *** CD-ROM | disk | FTP | other *** search
- cursorMove = new Object();
- cursorMove.onKeyDown = function()
- {
- if(Key.getCode() == 77)
- {
- if(isBgmPlay == true)
- {
- _root.bgm.stop();
- isBgmPlay = false;
- }
- else
- {
- _root.bgm.start(0,100000);
- isBgmPlay = true;
- }
- }
- if(Key.getCode() == 37)
- {
- if(cursorPosition > 1)
- {
- _root.moveS.start(0,l);
- _root.cursor._x -= 67;
- cursorPosition--;
- }
- else
- {
- cursorPosition = 8;
- _root.cursor._x += 469;
- }
- }
- if(Key.getCode() == 39)
- {
- if(cursorPosition < 8)
- {
- _root.moveS.start(0,l);
- _root.cursor._x += 67;
- cursorPosition++;
- }
- else
- {
- cursorPosition = 1;
- _root.cursor._x -= 469;
- }
- }
- if(Key.getCode() == 32)
- {
- if(isGamePlay == true)
- {
- if(cursorPosition == 8)
- {
- if(orderTyp == 1)
- {
- _root.bubS.start(0,1);
- _root.make.cup.nextFrame();
- if(_root.make.cup._currentframe == 13)
- {
- _root.gotoAndPlay("noGood");
- }
- }
- else
- {
- _root.noBtn.start(0,1);
- }
- }
- else
- {
- downS.start(0,1);
- _root.make["h" + cursorPosition].duplicateMovieClip("ham" + (_root.thisH + 1),_root.thisH + 10);
- _root.make["ham" + (_root.thisH + 1)]._x = 200;
- _root.make["ham" + (_root.thisH + 1)]._y = 100;
- _root.make["ham" + (_root.thisH + 1)].targetX = 200;
- if(_root.thisH > 0)
- {
- _root.make["ham" + (_root.thisH + 1)].targetY = _root.make["ham" + _root.thisH].targetY - _root["sTyp" + _root.nHamTyp[thisH - 1]];
- }
- else
- {
- _root.make["ham" + (_root.thisH + 1)].targetY = 445;
- }
- _root.make["ham" + (_root.thisH + 1)].isPlay = true;
- _root.nHamTyp.push(cursorPosition);
- if(cursorPosition != _root.hamTyp[_root.thisH])
- {
- _root.gotoAndPlay("noGood");
- }
- _root.thisH = _root.thisH + 1;
- }
- }
- }
- if(Key.getCode() == 13)
- {
- if(isGamePlay == true)
- {
- isGamePlay = false;
- i = 0;
- while(i < hamNum + 2)
- {
- if(_root.nHamTyp[i] != _root.hamTyp[i])
- {
- isGood = false;
- break;
- }
- isGood = true;
- i++;
- }
- if(orderTyp == 0)
- {
- if(isGood == true)
- {
- _root.score += 500 * (hamNum + 2);
- _root.gotoAndPlay("good");
- }
- else
- {
- _root.gotoAndPlay("noGood");
- }
- }
- else if(isGood == true && _root.make.cup._currentframe >= _root.make.cup.cupN._currentframe)
- {
- _root.score += 500 * (hamNum + 2) + 1000;
- _root.colaNum = _root.colaNum + 1;
- _root.gotoAndPlay("good");
- }
- else
- {
- _root.gotoAndPlay("noGood");
- }
- }
- }
- if(Key.isDown(35))
- {
- if(isGamePlay == true)
- {
- isGamePlay = false;
- i = 0;
- while(i < hamNum + 2)
- {
- if(_root.nHamTyp[i] != _root.hamTyp[i])
- {
- isGood = false;
- break;
- }
- isGood = true;
- i++;
- }
- if(orderTyp == 0)
- {
- if(isGood == true)
- {
- _root.score += 500 * (hamNum + 2);
- _root.gotoAndPlay("good");
- }
- else
- {
- _root.gotoAndPlay("noGood");
- }
- }
- else if(isGood == true && _root.make.cup._currentframe >= _root.make.cup.cupN._currentframe)
- {
- _root.score += 500 * (hamNum + 2) + 1000;
- _root.colaNum = _root.colaNum + 1;
- _root.gotoAndPlay("good");
- }
- else
- {
- _root.gotoAndPlay("noGood");
- }
- }
- }
- };
- Key.addListener(cursorMove);
-